BEGIN TRANSACTION;
BEGIN TRY
    -- 更新患者基本信息
    UPDATE Patients 
    SET Diagnosis = '高血压II级' 
    WHERE PatientID = 1001;

    -- 插入检查记录
    INSERT INTO MedicalExams (PatientID, ExamType, Result) 
    VALUES (1001, '血液检测', '指标正常');

    COMMIT TRANSACTION;
END TRY
BEGIN CATCH
    ROLLBACK TRANSACTION;
    PRINT '病历修改失败：' + ERROR_MESSAGE();
END CATCH;
